# -*- coding:utf-8 -*-
# Author:Ami

list_1 = [1, 4, 5, 6, 3, 3, 4, 5, 1, 2, 21, 3]
list_1 = set(list_1);

print(list_1, type(list_1))

list_2 = set([2, 6, 6, 66, 8, 3])
list_3 = set([1,4,5])
print(list_2)
# 取交集
print(list_1.intersection(list_2))
print(list_1 &list_2)
#并集
print(list_1.union(list_2))
print(list_1 | list_2)
#差集 1有2没有
print('cj',list_1.difference(list_2))
print(list_1 - list_2)
#是否子集
print(list_1.issubset(list_2))
print(list_3.issubset(list_1))
#是否父级
print(list_1.issuperset(list_2))
print(list_1.issuperset(list_3))

#对称差集 2个都没有的集合

print(list_1.symmetric_difference(list_2))
print(list_1 ^ list_2)
#判断两个集合是否包含相同的元素
print(list_1.isdisjoint(list_3))

#添加
list_1.add(23333)
list_1.update([888,889,996])
print(list_1)

#删除
list_1.remove('2333')

#长度
len(list_1)

#是否存在
"6" in list_1
